package com.wt.struggle.goodbye.main.activity

import android.os.Bundle
import android.webkit.WebChromeClient
import android.webkit.WebSettings
import android.webkit.WebViewClient
import com.wt.struggle.goodbye.R
import com.wt.struggle.goodbye.base.ProActivity
import com.wt.struggle.goodbye.info.NetInfo
import com.wt.struggle.goodbye.info.NewsInfo
import kotlinx.android.synthetic.main.head.*
import kotlinx.android.synthetic.main.web_view_layout.*

class WebViewActivity : ProActivity() {

    override fun handler(what: Int, arg1: Int, netInfo: NetInfo) {

    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.web_view_layout)

        tvTitle.text = ""
        val info = intent.getParcelableExtra<NewsInfo>("info")

        imageBack.setOnClickListener {
            finish()
        }

        val set = webView.settings
        set.cacheMode = WebSettings.LOAD_CACHE_ELSE_NETWORK
        set.javaScriptEnabled = true
        webView.loadUrl(info.linkUrl)
        webView.webViewClient = object : WebViewClient() {

        }
        webView.webChromeClient = object : WebChromeClient() {

        }


    }
}